﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using TinyForum.DataObjects;

namespace TinyForum.Application
{
    [ServiceContract(Namespace = "http://www.tinyforum.com")]
    public interface ITopicApplication
    {
        [OperationContract]
        [FaultContract(typeof(ApplicationFaultDetail))]
        long CreateTopic(string name, string description);

        [OperationContract(Name="GetTopicById")]
        [FaultContract(typeof(ApplicationFaultDetail))]
        TopicDataObject GetTopic(long id);

        [OperationContract(Name = "GetTopicDetailById")]
        [FaultContract(typeof(ApplicationFaultDetail))]
        TopicDetailDataObject GetTopicDetail(long topicId);

        [OperationContract]
        [FaultContract(typeof(ApplicationFaultDetail))]
        IEnumerable<TopicDetailDataObject> GetTopicDetails();

        [OperationContract(Name="GetPosts")]
        [FaultContract(typeof(ApplicationFaultDetail))]
        IEnumerable<PostDataObject> GetPosts(long topicId, PostSortDataObject postSort, SortOrderDataObject sortOrder);
    }
}
